package com.mapforge.listener;

import com.mapforge.io.IOHandlerInterface;
import com.mapforge.map.Tileset;

public class TilesetIOHandlerChangeEvent extends BasicEvent{
	/**
	 * The old tileset IO handler the application was using
	 */
	private IOHandlerInterface<Tileset> oldHandler;

	/**
	 * The new tileset IO handler the application is now using.
	 */
	private IOHandlerInterface<Tileset> newHandler;

	/**
	 * Creates a new Tileset IO change event using the specified new and old
	 * handlers, and the source which initiated this event. The source may be
	 * null.
	 * 
	 * @param newHandler
	 *            the new tileset io handler the application is now using
	 * @param oldHandler
	 *            old tileset io handler the application was using
	 * @param src
	 *            source which initiated the event
	 */
	public TilesetIOHandlerChangeEvent(Object src, IOHandlerInterface<Tileset> newHandler,
			IOHandlerInterface<Tileset> oldHandler) {
		super(src);
		this.newHandler = newHandler;
		this.oldHandler = oldHandler;
	}

	/**
	 * Returns the previous tileset IO handler
	 * 
	 * @return
	 */
	public IOHandlerInterface<Tileset> getOldHandler() {
		return oldHandler;
	}

	/**
	 * Returns the new tileset IO handler.
	 * 
	 * @return
	 */
	public IOHandlerInterface<Tileset> getNewHandler() {
		return newHandler;
	}
}
